Skip to content

Router: auto HEAD to GET#2949

Open
aldas wants to merge 4 commits into
labstack:masterfrom
aldas:alternative_heat_to_get
Open

Router: auto HEAD to GET#2949
aldas wants to merge 4 commits into
labstack:masterfrom
aldas:alternative_heat_to_get

Conversation

@aldas

@aldas aldas commented Apr 19, 2026

Copy link
Copy Markdown
Contributor

Proposal for alternative solution to #2944 (#2895) - do not register extra routes. use router internals to fallback from head to get. these extra IF checks do not register as meaningful change when running benchstat, but registering another route along with GET looks like a quick hack.

store benchmarks for this change

go test -run="-" -bench=".*" -count=8 ./... > benchmark_with_head.txt

check out current version

go test -run="-" -bench=".*" -count=8 ./... > benchmark_5_1_0.txt

and compare these two

benchstat benchmark_5_1_0.txt benchmark_with_head.txt 

usage:

Create Echo instance with Router that is configured with AutoHandleHEAD = true

			e := echo.NewWithConfig(echo.Config{
				Router: echo.NewRouter(echo.RouterConfig{
					AutoHandleHEAD: true,
				}),
			})

@codecov

codecov Bot commented Apr 19, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.29730% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 93.33%. Comparing base (01b45be) to head (58f8903).
⚠️ Report is 9 commits behind head on master.

Files with missing lines Patch % Lines
response.go 96.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2949      +/-   ##
==========================================
+ Coverage   93.17%   93.33%   +0.15%     
==========================================
  Files          43       43              
  Lines        4501     4564      +63     
==========================================
+ Hits         4194     4260      +66     
+ Misses        189      186       -3     
  Partials      118      118              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@atharvaSharma17

atharvaSharma17 commented Apr 25, 2026

Copy link
Copy Markdown

Any updates on this ??

@aldas aldas changed the title WIP: Alternative heat to get WIP: Alternative HEAD to GET Jun 9, 2026
@aldas aldas force-pushed the alternative_heat_to_get branch from 49b5ca9 to a1867aa Compare June 9, 2026 17:41
@aldas aldas force-pushed the alternative_heat_to_get branch from a1867aa to 58f8903 Compare June 9, 2026 19:18
@aldas aldas changed the title WIP: Alternative HEAD to GET Router: auto HEAD to GET Jun 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants